package com.swind.fast.modules.app.halali.common.constant.enums;

/**
 * 分类
 */
public enum DeliveryType {
    DELIVERY(0, "Delivery"),
    PICKUP(1, "Pickup");
    int code;
    String title;
    DeliveryType(int code, String title) {
        this.code = code;
        this.title = title;
    }
    public int getCode() {
        return code;
    }
    public void setCode(int code) {
        this.code = code;
    }
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public static DeliveryType getDeliveryTypeByCode(Integer code) {
        for (DeliveryType e : DeliveryType.values()) {
            if (e.code == code) {
                return e;
            }
        }
        return null;
    }

    public static String getTitleByCode(Integer code) {
        for (DeliveryType e : DeliveryType.values()) {
            if (e.code == code) {
                return e.title;
            }
        }
        return "";
    }
}
